﻿using BCData.OA.WorkflowActivity.WorkflowActivitySpecificFormExecuteRecord;
using BCDto.OA.WorkflowActive.WorkflowActivitySpecificFormExecuteRecord;
using BCEntity.OA.WorkflowActive.WorkflowActivitySpecificFormExecuteRecord;
using BCService.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCService.OA.WorkflowActivitySpecificFormExecuteRecord
{
    public class WorkflowActivitySpecificFormExecuteRecordService : IWorkflowActivitySpecificFormExecuteRecordService
    {
        private readonly IWorkflowActivitySpecificFormExecuteRecordData workflowActivitySpecificFormExecuteRecordData;

        public WorkflowActivitySpecificFormExecuteRecordService(IWorkflowActivitySpecificFormExecuteRecordData workflowActivitySpecificFormExecuteRecordData)
        {
            this.workflowActivitySpecificFormExecuteRecordData = workflowActivitySpecificFormExecuteRecordData;
        }

        public IEnumerable<WorkflowActivitySpecificFormExecuteRecordDto> GetByWorkflowActivityId(long workflowActivityId)
        {
            return this.workflowActivitySpecificFormExecuteRecordData.GetByWorkflowActivityId(workflowActivityId).Result.As<IEnumerable<WorkflowActivitySpecificFormExecuteRecordDto>>();
        }

        public WorkflowActivitySpecificFormExecuteRecordDto Insert(WorkflowActivitySpecificFormExecuteRecordDto dto)
        {
            return this.workflowActivitySpecificFormExecuteRecordData.Insert(dto.As<WorkflowActivitySpecificFormExecuteRecordEntity>()).Result.As<WorkflowActivitySpecificFormExecuteRecordDto>();
        }
    }
}
